<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>新活动发布</h2>
    </div>
    <form action="{:U()}" method="post" enctype="multipart/form-data" class="form-horizontal">
        <input type="hidden" name='id' value='{$data.id}'/>
        <div class="form-item">
            <label class="item-label">模版标题</label>
            <div class="controls">
                <input type="text" class="text input-large" name="name" value="{$data.name}" placeholder="模版标题">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">模版简码</label>
            <div class="controls">
                <input type="text" class="text input-large" name="bin" value="{$data.bin}" placeholder="mbjm">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">是否可分享</label>
            <div class="controls">
                <input type="checkbox" name="share" id="share" onclick="setShare()" <eq name="data.share" value="1">checked="checked" </eq> />允许分享
            </div>
        </div>
        <div class="form-item share"  style="display: none">
            <label class="item-label">分享标题</label>
            <div class="controls">
                <input type="text" class="text input-large" name="title" value="{$data.title}" placeholder="分享标题">
            </div>
        </div>
        <div class="form-item share" style="display: none">
            <label class="item-label">分享简介</label>
            <div class="controls">
                <input type="text" class="text input-large" name="desc" value="{$data.desc}" placeholder="分享简介">
            </div>
        </div>
        <div class="form-item share" style="display: none">
            <label class="item-label">分享链接</label>
            <div class="controls">
                <input type="text" class="text input-large" name="link" value="{$data.link}" placeholder="分享链接">
            </div>
        </div>
        <div class="form-item share" style="display: none">
            <label class="item-label">分享小图</label>
            <div class="controls">
                <img src="{$data.imgUrl}" width="160" height="90">
                <input type="file" name="imgUrl" >
            </div>
        </div>
        <div class="form-item share" style="display: none">
            <label class="item-label">分享成功后跳转连接</label>
            <div class="controls">
                <input type="text" class="text input-large" name="successUrl" value="{$data.successUrl}" placeholder="分享成功后跳转连接">
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">模版详情<span class="check-tips"></span></label>
            <div class="controls">

                {:hook('adminArticleEdit', array('name'=>'content'))}

                <textarea name="content">{$data.content}</textarea>
            </div>
        </div>
        <div class="form-item">
            <button class="btn submit-btn  "  id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);
                    return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        var share = $('#share').prop('checked');
        if (share){
            $('.share').show();
        }
        highlight_subnav('{:U('Activity/index')}');

        function setShare(){
            var share = $('#share').prop('checked');
            if (share){
                $('.share').show();
            }else{
                $('.share').hide();
            }
        }
    </script>
</block>
